package com.adcc.ags.cgw.configuration;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * MQ配置工厂
 */
public class MQFactory {

    // 主机名称
    @NotEmpty
    private String host;

    // 端口
    @Min(0)
    @Max(65535)
    private int port;

    // 通道
    @NotEmpty
    private String channel;

    // QueueManager
    @NotEmpty
    private String queueManager;

    // ActiveMode
    @Min(0)
    @Max(2)
    private int activeMode;

    // 连接超时时间
    @Min(0)
    @Max(3600000)
    private long timeout;

    // 最大连接数
    @Min(0)
    @Max(9192)
    private int maxConnections;

    // 最大空闲连接数
    @Min(0)
    @Max(2048)
    private int maxIdelConnections;

    @JsonProperty("host")
    public String getHost() {
        return host;
    }

    @JsonProperty("host")
    public void setHost(String host) {
        this.host = host;
    }

    @JsonProperty("port")
    public int getPort() {
        return port;
    }

    @JsonProperty("port")
    public void setPort(int port) {
        this.port = port;
    }

    @JsonProperty("channel")
    public String getChannel() {
        return channel;
    }

    @JsonProperty("channel")
    public void setChannel(String channel) {
        this.channel = channel;
    }

    @JsonProperty("queueManager")
    public String getQueueManager() {
        return queueManager;
    }

    @JsonProperty("queueManager")
    public void setQueueManager(String queueManager) {
        this.queueManager = queueManager;
    }

    @JsonProperty("activeMode")
    public int getActiveMode() {
        return activeMode;
    }

    @JsonProperty("activeMode")
    public void setActiveMode(int activeMode) {
        this.activeMode = activeMode;
    }

    @JsonProperty("timeout")
    public long getTimeout() {
        return timeout;
    }

    @JsonProperty("timeout")
    public void setTimeout(long timeout) {
        this.timeout = timeout;
    }

    @JsonProperty("maxConnections")
    public int getMaxConnections() {
        return maxConnections;
    }

    @JsonProperty("maxConnections")
    public void setMaxConnections(int maxConnections) {
        this.maxConnections = maxConnections;
    }

    @JsonProperty("maxIdelConnections")
    public int getMaxIdelConnections() {
        return maxIdelConnections;
    }

    @JsonProperty("maxIdelConnections")
    public void setMaxIdelConnections(int maxIdelConnections) {
        this.maxIdelConnections = maxIdelConnections;
    }
}
